package com.pj.hellomvvm.utils

import android.content.Context
import androidx.core.content.ContextCompat
import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat

object DrawableUtils {
    fun vectorDrawable(context: Context, drawableId: Int, color: Int): VectorDrawableCompat? {
        val vector = VectorDrawableCompat.create(context.resources, drawableId, context.theme)
        vector?.setTint(ContextCompat.getColor(context, color))
        return vector
    }
}